package eco2automotive.data;
import java.io.*;
 /**  
  * This object serializable contains the data neccesary to indetify 
  * a error code Example: P0133.
  * This Structure is based on the ErrorTorubleCodes.xml file.
  * @version 1.0
  * @autor Fco. Javier Sánchez Esparza
  *
  */ 
public class ErrorCode implements Serializable{

    private String code;
    private String description;
    /**        
     * Default constructor  
     */
public ErrorCode(){}
  /** 
     *  Constructor
     * @param code the identifier of error
     * @param description full information     
    */
public ErrorCode(String code, String description)
    {
        this.code=code.replaceAll(" ","");
        this.description=description;
    }
    /**      
    *  Set the string code eg. P0133
     * @param code - String of code    
    */
    public void setCode(String code){this.code=code;}
    /**      
     * Set a string description
     * @param description - String of description
    */
    public void setDescription(String description){
        this.description=description;}
    
    /**      
     * Return a String code
     * @return code - String of code    
    */   
    public String getCode()
    {
        return this.code;
    }
    /**      
     * @return description - String of description    
    */   
    public String getDescription(){return this.description;}
}
